$(function() {
	var minutesT = $(".meeting-minutes").offset().top;
	var minutesW = $(".meeting-minutes").outerWidth(true);
	var right = $("body").outerWidth(true)*0.1;
	var minutesH = $(window).outerHeight(true)-40;
	$(".meetingM-tab-section").css({"height":minutesH+"px"});
	//alert(minutesH);
	$(window).scroll(function(){
		var scroH = $(this).scrollTop();
		if(scroH > minutesT){
			$(".meeting-minutes").css({"position":"fixed","top":0, "width":minutesW+"px","right":right+"px"});
		}else{
			$(".meeting-minutes").css({"position":"relative","right":0});
		}
	});


	$("#create_project").click(function(){
		//$("body").css({"overflow-y":"hidden"});
		creatProject();
		//$(".newObject-mask").show();
	});
	
	//console.log($("#proForm").serialize());
	$(".status-choose p").on("click",function(){
		$(this).addClass("on").siblings().removeClass("on");
	})
	$("#newProject_Submit").click(function(){
		alert($("#proForm").serialize());
		$.ajax({
			type : 'post',
			url : '',
			data: $("#proForm").serialize(),
			dataType : 'json',
			success : function(data){
				if(data.status==0){
					
				}else{
					
				}
			},
			error:function(){
			}
		});
	})

	
});
function projectClick(){
	$(function() {
		$(".client-name a").click(function(){
			var name=$(this).text();
			var parentBox = $(this).parent();
			var msgBox = parentBox.find(".index-msg-box");
			if(msgBox.hasClass("client-msg")){
				msgBox.remove();
			}else{
				parentBox.append(clientMsg(name));
			}
		});

		$(".project-item h3 a").click(function(){
			var parentBox = $(this).parent();
			var msgBox = parentBox.find(".index-msg-box");
			if(msgBox.hasClass("project-msg")){
				msgBox.remove();
			}else{
				parentBox.append(projectMsg());
			}
		});
		$(".meetM-btn").click(function(){
			var name=$(this).parent().parent().find("h3").text();
			meetingMin(name);
		});
	});
}

function clientMsg(name){
	var html = '';
	html = html + '<div class=\"index-msg-box client-msg\">';
	html = html + '<p>name:<span>'+name+'</span></p>';
	html = html + '<p>contact:<span>John</span></p>';
	html = html + '<p>email:<span>nike@163.com</span></p>';
	html = html + '<p>mobile:<span>15002340789</span></p>';
	html = html + '<p>industry:<span>Economic</span></p>';
	html = html + '<p>region:<span>Shanghai</span></p>';
	html = html + '</div>';
	return html;
}

